home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / xpcom / nsIComponentRegistrar.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  17KB  |  376 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIComponentRegistrar.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIComponentRegistrar_h__
  6. #define __gen_nsIComponentRegistrar_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17. class nsIFile; /* forward declaration */
  18.  
  19. class nsIFactory; /* forward declaration */
  20.  
  21. class nsISimpleEnumerator; /* forward declaration */
  22.  
  23.  
  24. /* starting interface:    nsIComponentRegistrar */
  25. #define NS_ICOMPONENTREGISTRAR_IID_STR "2417cbfe-65ad-48a6-b4b6-eb84db174392"
  26.  
  27. #define NS_ICOMPONENTREGISTRAR_IID \
  28.   {0x2417cbfe, 0x65ad, 0x48a6, \
  29.     { 0xb4, 0xb6, 0xeb, 0x84, 0xdb, 0x17, 0x43, 0x92 }}
  30.  
  31. class NS_NO_VTABLE nsIComponentRegistrar : public nsISupports {
  32.  public: 
  33.  
  34.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_ICOMPONENTREGISTRAR_IID)
  35.  
  36.   /**
  37.      * autoRegister
  38.      *
  39.      * Register a component file or all component files in a directory.  
  40.      *
  41.      * Component files must have an associated loader and export the required
  42.      * symbols which this loader defines.  For example, if the given file is a
  43.      * native library (which is built into XPCOM), it must export the symbol 
  44.      * "NSGetModule".  Other loaders may have different semantics.
  45.      *
  46.      * This method may only be called from the main thread.
  47.      * 
  48.      * @param aSpec    : Filename spec for component file's location. If aSpec 
  49.      *                   is a directory, then every component file in the
  50.      *                   directory will be registered.  
  51.      *                   If the aSpec is null, then the application component's
  52.      *                   directory as defined by NS_XPCOM_COMPONENT_DIR will be 
  53.      *                   registered  (see nsIDirectoryService.idl)
  54.      *
  55.      * @return NS_OK   : Registration was successful.
  56.      *         NS_ERROR: Method failure.
  57.      */
  58.   /* void autoRegister (in nsIFile aSpec); */
  59.   NS_IMETHOD AutoRegister(nsIFile *aSpec) = 0;
  60.  
  61.   /**
  62.      * autoUnregister
  63.      *
  64.      * Unregister a component file or all component files in a directory.  
  65.      * This method may only be called from the main thread.
  66.      *
  67.      * @param aSpec    : Filename spec for component file's location. If aSpec 
  68.      *                   is a directory, the every component file in the directory 
  69.      *                   will be registered.  
  70.      *                   If aSpec is null, then the application component's 
  71.      *                   directory as defined by NS_XPCOM_COMPONENT_DIR will be 
  72.      *                   registered. (see nsIDirectoryService.idl)
  73.      *
  74.      * @return NS_OK     Unregistration was successful.
  75.      *         NS_ERROR* Method failure.
  76.      */
  77.   /* void autoUnregister (in nsIFile aSpec); */
  78.   NS_IMETHOD AutoUnregister(nsIFile *aSpec) = 0;
  79.  
  80.   /**
  81.      * registerFactory
  82.      *
  83.      * Register a factory with a given ContractID, CID and Class Name.
  84.      *
  85.      * @param aClass      : CID of object
  86.      * @param aClassName  : Class Name of CID
  87.      * @param aContractID : ContractID associated with CID aClass
  88.      * @param aFactory    : Factory that will be registered for CID aClass
  89.      *
  90.      * @return NS_OK        Registration was successful.
  91.      *         NS_ERROR*    method failure.
  92.      */
  93.   /* void registerFactory (in nsCIDRef aClass, in string aClassName, in string aContractID, in nsIFactory aFactory); */
  94.   NS_IMETHOD RegisterFactory(const nsCID & aClass, const char *aClassName, const char *aContractID, nsIFactory *aFactory) = 0;
  95.  
  96.   /**
  97.      * unregisterFactory
  98.      *
  99.      * Unregister a factory associated with CID aClass.
  100.      *
  101.      * @param aClass   : CID being unregistered
  102.      * @param aFactory : Factory previously registered to create instances of
  103.      *                   CID aClass.
  104.      *
  105.      * @return NS_OK     Unregistration was successful.
  106.      *         NS_ERROR* Method failure.
  107.      */
  108.   /* void unregisterFactory (in nsCIDRef aClass, in nsIFactory aFactory); */
  109.   NS_IMETHOD UnregisterFactory(const nsCID & aClass, nsIFactory *aFactory) = 0;
  110.  
  111.   /**
  112.      * registerFactoryLocation
  113.      *
  114.      * Register a factory with a given ContractID, CID and Class Name
  115.      *
  116.      * @param aClass      : CID of object
  117.      * @param aClassName  : Class Name of CID
  118.      * @param aContractID : ContractID associated with CID aClass
  119.      * @param aFile       : Component File. This file must have an associated 
  120.      *                      loader and export the required symbols which this 
  121.      *                      loader specifies.
  122.      * @param aLoaderStr  : Opaque loader specific string.  This value is
  123.      *                      passed into the nsIModule's registerSelf
  124.      *                      callback and must be fowarded unmodified when
  125.      *                      registering factories via their location.
  126.      * @param aType       : Component Type of CID aClass.  This value is
  127.      *                      passed into the nsIModule's registerSelf
  128.      *                      callback and must be fowarded unmodified when
  129.      *                      registering factories via their location.
  130.      *
  131.      * @return NS_OK        Registration was successful.
  132.      *         NS_ERROR*    Method failure.
  133.      */
  134.   /* void registerFactoryLocation (in nsCIDRef aClass, in string aClassName, in string aContractID, in nsIFile aFile, in string aLoaderStr, in string aType); */
  135.   NS_IMETHOD RegisterFactoryLocation(const nsCID & aClass, const char *aClassName, const char *aContractID, nsIFile *aFile, const char *aLoaderStr, const char *aType) = 0;
  136.  
  137.   /**
  138.      * unregisterFactoryLocation
  139.      *
  140.      * Unregister a factory associated with CID aClass.
  141.      *
  142.      * @param aClass   : CID being unregistered
  143.      * @param aFile    : Component File previously registered
  144.      *
  145.      * @return NS_OK     Unregistration was successful.
  146.      *         NS_ERROR* Method failure.
  147.      */
  148.   /* void unregisterFactoryLocation (in nsCIDRef aClass, in nsIFile aFile); */
  149.   NS_IMETHOD UnregisterFactoryLocation(const nsCID & aClass, nsIFile *aFile) = 0;
  150.  
  151.   /**
  152.      * isCIDRegistered
  153.      *
  154.      * Returns true if a factory is registered for the CID.
  155.      *
  156.      * @param aClass : CID queried for registeration
  157.      * @return       : true if a factory is registered for CID 
  158.      *                 false otherwise.
  159.      */
  160.   /* boolean isCIDRegistered (in nsCIDRef aClass); */
  161.   NS_IMETHOD IsCIDRegistered(const nsCID & aClass, PRBool *_retval) = 0;
  162.  
  163.   /**
  164.      * isContractIDRegistered
  165.      *
  166.      * Returns true if a factory is registered for the contract id.
  167.      *
  168.      * @param aClass : contract id queried for registeration
  169.      * @return       : true if a factory is registered for contract id 
  170.      *                 false otherwise.
  171.      */
  172.   /* boolean isContractIDRegistered (in string aContractID); */
  173.   NS_IMETHOD IsContractIDRegistered(const char *aContractID, PRBool *_retval) = 0;
  174.  
  175.   /**
  176.      * enumerateCIDs
  177.      *
  178.      * Enumerate the list of all registered CIDs.
  179.      *
  180.      * @return : enumerator for CIDs.  Elements of the enumeration can be QI'ed
  181.      *           for the nsISupportsID interface.  From the nsISupportsID, you 
  182.      *           can obtain the actual CID.
  183.      */
  184.   /* nsISimpleEnumerator enumerateCIDs (); */
  185.   NS_IMETHOD EnumerateCIDs(nsISimpleEnumerator **_retval) = 0;
  186.  
  187.   /**
  188.      * enumerateContractIDs
  189.      *
  190.      * Enumerate the list of all registered ContractIDs.
  191.      *
  192.      * @return : enumerator for ContractIDs. Elements of the enumeration can be 
  193.      *           QI'ed for the nsISupportsCString interface.  From  the
  194.      *           nsISupportsCString interface, you can obtain the actual 
  195.      *           Contract ID string.
  196.      */
  197.   /* nsISimpleEnumerator enumerateContractIDs (); */
  198.   NS_IMETHOD EnumerateContractIDs(nsISimpleEnumerator **_retval) = 0;
  199.  
  200.   /**
  201.      * CIDToContractID
  202.      *
  203.      * Returns the Contract ID for a given CID, if one exists and is registered.
  204.      *
  205.      * @return : Contract ID.
  206.      */
  207.   /* string CIDToContractID (in nsCIDRef aClass); */
  208.   NS_IMETHOD CIDToContractID(const nsCID & aClass, char **_retval) = 0;
  209.  
  210.   /**
  211.      * contractIDToCID
  212.      *
  213.      * Returns the CID for a given Contract ID, if one exists and is registered.
  214.      *
  215.      * @return : Contract ID.
  216.      */
  217.   /* nsCIDPtr contractIDToCID (in string aContractID); */
  218.   NS_IMETHOD ContractIDToCID(const char *aContractID, nsCID * *_retval) = 0;
  219.  
  220. };
  221.  
  222. /* Use this macro when declaring classes that implement this interface. */
  223. #define NS_DECL_NSICOMPONENTREGISTRAR \
  224.   NS_IMETHOD AutoRegister(nsIFile *aSpec); \
  225.   NS_IMETHOD AutoUnregister(nsIFile *aSpec); \
  226.   NS_IMETHOD RegisterFactory(const nsCID & aClass, const char *aClassName, const char *aContractID, nsIFactory *aFactory); \
  227.   NS_IMETHOD UnregisterFactory(const nsCID & aClass, nsIFactory *aFactory); \
  228.   NS_IMETHOD RegisterFactoryLocation(const nsCID & aClass, const char *aClassName, const char *aContractID, nsIFile *aFile, const char *aLoaderStr, const char *aType); \
  229.   NS_IMETHOD UnregisterFactoryLocation(const nsCID & aClass, nsIFile *aFile); \
  230.   NS_IMETHOD IsCIDRegistered(const nsCID & aClass, PRBool *_retval); \
  231.   NS_IMETHOD IsContractIDRegistered(const char *aContractID, PRBool *_retval); \
  232.   NS_IMETHOD EnumerateCIDs(nsISimpleEnumerator **_retval); \
  233.   NS_IMETHOD EnumerateContractIDs(nsISimpleEnumerator **_retval); \
  234.   NS_IMETHOD CIDToContractID(const nsCID & aClass, char **_retval); \
  235.   NS_IMETHOD ContractIDToCID(const char *aContractID, nsCID * *_retval); 
  236.  
  237. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  238. #define NS_FORWARD_NSICOMPONENTREGISTRAR(_to) \
  239.   NS_IMETHOD AutoRegister(nsIFile *aSpec) { return _to AutoRegister(aSpec); } \
  240.   NS_IMETHOD AutoUnregister(nsIFile *aSpec) { return _to AutoUnregister(aSpec); } \
  241.   NS_IMETHOD RegisterFactory(const nsCID & aClass, const char *aClassName, const char *aContractID, nsIFactory *aFactory) { return _to RegisterFactory(aClass, aClassName, aContractID, aFactory); } \
  242.   NS_IMETHOD UnregisterFactory(const nsCID & aClass, nsIFactory *aFactory) { return _to UnregisterFactory(aClass, aFactory); } \
  243.   NS_IMETHOD RegisterFactoryLocation(const nsCID & aClass, const char *aClassName, const char *aContractID, nsIFile *aFile, const char *aLoaderStr, const char *aType) { return _to RegisterFactoryLocation(aClass, aClassName, aContractID, aFile, aLoaderStr, aType); } \
  244.   NS_IMETHOD UnregisterFactoryLocation(const nsCID & aClass, nsIFile *aFile) { return _to UnregisterFactoryLocation(aClass, aFile); } \
  245.   NS_IMETHOD IsCIDRegistered(const nsCID & aClass, PRBool *_retval) { return _to IsCIDRegistered(aClass, _retval); } \
  246.   NS_IMETHOD IsContractIDRegistered(const char *aContractID, PRBool *_retval) { return _to IsContractIDRegistered(aContractID, _retval); } \
  247.   NS_IMETHOD EnumerateCIDs(nsISimpleEnumerator **_retval) { return _to EnumerateCIDs(_retval); } \
  248.   NS_IMETHOD EnumerateContractIDs(nsISimpleEnumerator **_retval) { return _to EnumerateContractIDs(_retval); } \
  249.   NS_IMETHOD CIDToContractID(const nsCID & aClass, char **_retval) { return _to CIDToContractID(aClass, _retval); } \
  250.   NS_IMETHOD ContractIDToCID(const char *aContractID, nsCID * *_retval) { return _to ContractIDToCID(aContractID, _retval); } 
  251.  
  252. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  253. #define NS_FORWARD_SAFE_NSICOMPONENTREGISTRAR(_to) \
  254.   NS_IMETHOD AutoRegister(nsIFile *aSpec) { return !_to ? NS_ERROR_NULL_POINTER : _to->AutoRegister(aSpec); } \
  255.   NS_IMETHOD AutoUnregister(nsIFile *aSpec) { return !_to ? NS_ERROR_NULL_POINTER : _to->AutoUnregister(aSpec); } \
  256.   NS_IMETHOD RegisterFactory(const nsCID & aClass, const char *aClassName, const char *aContractID, nsIFactory *aFactory) { return !_to ? NS_ERROR_NULL_POINTER : _to->RegisterFactory(aClass, aClassName, aContractID, aFactory); } \
  257.   NS_IMETHOD UnregisterFactory(const nsCID & aClass, nsIFactory *aFactory) { return !_to ? NS_ERROR_NULL_POINTER : _to->UnregisterFactory(aClass, aFactory); } \
  258.   NS_IMETHOD RegisterFactoryLocation(const nsCID & aClass, const char *aClassName, const char *aContractID, nsIFile *aFile, const char *aLoaderStr, const char *aType) { return !_to ? NS_ERROR_NULL_POINTER : _to->RegisterFactoryLocation(aClass, aClassName, aContractID, aFile, aLoaderStr, aType); } \
  259.   NS_IMETHOD UnregisterFactoryLocation(const nsCID & aClass, nsIFile *aFile) { return !_to ? NS_ERROR_NULL_POINTER : _to->UnregisterFactoryLocation(aClass, aFile); } \
  260.   NS_IMETHOD IsCIDRegistered(const nsCID & aClass, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->IsCIDRegistered(aClass, _retval); } \
  261.   NS_IMETHOD IsContractIDRegistered(const char *aContractID, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->IsContractIDRegistered(aContractID, _retval); } \
  262.   NS_IMETHOD EnumerateCIDs(nsISimpleEnumerator **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->EnumerateCIDs(_retval); } \
  263.   NS_IMETHOD EnumerateContractIDs(nsISimpleEnumerator **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->EnumerateContractIDs(_retval); } \
  264.   NS_IMETHOD CIDToContractID(const nsCID & aClass, char **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->CIDToContractID(aClass, _retval); } \
  265.   NS_IMETHOD ContractIDToCID(const char *aContractID, nsCID * *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->ContractIDToCID(aContractID, _retval); } 
  266.  
  267. #if 0
  268. /* Use the code below as a template for the implementation class for this interface. */
  269.  
  270. /* Header file */
  271. class nsComponentRegistrar : public nsIComponentRegistrar
  272. {
  273. public:
  274.   NS_DECL_ISUPPORTS
  275.   NS_DECL_NSICOMPONENTREGISTRAR
  276.  
  277.   nsComponentRegistrar();
  278.  
  279. private:
  280.   ~nsComponentRegistrar();
  281.  
  282. protected:
  283.   /* additional members */
  284. };
  285.  
  286. /* Implementation file */
  287. NS_IMPL_ISUPPORTS1(nsComponentRegistrar, nsIComponentRegistrar)
  288.  
  289. nsComponentRegistrar::nsComponentRegistrar()
  290. {
  291.   /* member initializers and constructor code */
  292. }
  293.  
  294. nsComponentRegistrar::~nsComponentRegistrar()
  295. {
  296.   /* destructor code */
  297. }
  298.  
  299. /* void autoRegister (in nsIFile aSpec); */
  300. NS_IMETHODIMP nsComponentRegistrar::AutoRegister(nsIFile *aSpec)
  301. {
  302.     return NS_ERROR_NOT_IMPLEMENTED;
  303. }
  304.  
  305. /* void autoUnregister (in nsIFile aSpec); */
  306. NS_IMETHODIMP nsComponentRegistrar::AutoUnregister(nsIFile *aSpec)
  307. {
  308.     return NS_ERROR_NOT_IMPLEMENTED;
  309. }
  310.  
  311. /* void registerFactory (in nsCIDRef aClass, in string aClassName, in string aContractID, in nsIFactory aFactory); */
  312. NS_IMETHODIMP nsComponentRegistrar::RegisterFactory(const nsCID & aClass, const char *aClassName, const char *aContractID, nsIFactory *aFactory)
  313. {
  314.     return NS_ERROR_NOT_IMPLEMENTED;
  315. }
  316.  
  317. /* void unregisterFactory (in nsCIDRef aClass, in nsIFactory aFactory); */
  318. NS_IMETHODIMP nsComponentRegistrar::UnregisterFactory(const nsCID & aClass, nsIFactory *aFactory)
  319. {
  320.     return NS_ERROR_NOT_IMPLEMENTED;
  321. }
  322.  
  323. /* void registerFactoryLocation (in nsCIDRef aClass, in string aClassName, in string aContractID, in nsIFile aFile, in string aLoaderStr, in string aType); */
  324. NS_IMETHODIMP nsComponentRegistrar::RegisterFactoryLocation(const nsCID & aClass, const char *aClassName, const char *aContractID, nsIFile *aFile, const char *aLoaderStr, const char *aType)
  325. {
  326.     return NS_ERROR_NOT_IMPLEMENTED;
  327. }
  328.  
  329. /* void unregisterFactoryLocation (in nsCIDRef aClass, in nsIFile aFile); */
  330. NS_IMETHODIMP nsComponentRegistrar::UnregisterFactoryLocation(const nsCID & aClass, nsIFile *aFile)
  331. {
  332.     return NS_ERROR_NOT_IMPLEMENTED;
  333. }
  334.  
  335. /* boolean isCIDRegistered (in nsCIDRef aClass); */
  336. NS_IMETHODIMP nsComponentRegistrar::IsCIDRegistered(const nsCID & aClass, PRBool *_retval)
  337. {
  338.     return NS_ERROR_NOT_IMPLEMENTED;
  339. }
  340.  
  341. /* boolean isContractIDRegistered (in string aContractID); */
  342. NS_IMETHODIMP nsComponentRegistrar::IsContractIDRegistered(const char *aContractID, PRBool *_retval)
  343. {
  344.     return NS_ERROR_NOT_IMPLEMENTED;
  345. }
  346.  
  347. /* nsISimpleEnumerator enumerateCIDs (); */
  348. NS_IMETHODIMP nsComponentRegistrar::EnumerateCIDs(nsISimpleEnumerator **_retval)
  349. {
  350.     return NS_ERROR_NOT_IMPLEMENTED;
  351. }
  352.  
  353. /* nsISimpleEnumerator enumerateContractIDs (); */
  354. NS_IMETHODIMP nsComponentRegistrar::EnumerateContractIDs(nsISimpleEnumerator **_retval)
  355. {
  356.     return NS_ERROR_NOT_IMPLEMENTED;
  357. }
  358.  
  359. /* string CIDToContractID (in nsCIDRef aClass); */
  360. NS_IMETHODIMP nsComponentRegistrar::CIDToContractID(const nsCID & aClass, char **_retval)
  361. {
  362.     return NS_ERROR_NOT_IMPLEMENTED;
  363. }
  364.  
  365. /* nsCIDPtr contractIDToCID (in string aContractID); */
  366. NS_IMETHODIMP nsComponentRegistrar::ContractIDToCID(const char *aContractID, nsCID * *_retval)
  367. {
  368.     return NS_ERROR_NOT_IMPLEMENTED;
  369. }
  370.  
  371. /* End of implementation class template. */
  372. #endif
  373.  
  374.  
  375. #endif /* __gen_nsIComponentRegistrar_h__ */
  376.